package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InventoryCheckDetailMapper;
import com.ruoyi.system.domain.InventoryCheckDetail;
import com.ruoyi.system.service.IInventoryCheckDetailService;

/**
 * 库存盘点单据详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-17
 */
@Service
public class InventoryCheckDetailServiceImpl implements IInventoryCheckDetailService 
{
    @Autowired
    private InventoryCheckDetailMapper inventoryCheckDetailMapper;

    /**
     * 查询库存盘点单据详情
     * 
     * @param id 库存盘点单据详情主键
     * @return 库存盘点单据详情
     */
    @Override
    public InventoryCheckDetail selectInventoryCheckDetailById(Long id)
    {
        return inventoryCheckDetailMapper.selectInventoryCheckDetailById(id);
    }

    /**
     * 查询库存盘点单据详情列表
     * 
     * @param inventoryCheckDetail 库存盘点单据详情
     * @return 库存盘点单据详情
     */
    @Override
    public List<InventoryCheckDetail> selectInventoryCheckDetailList(InventoryCheckDetail inventoryCheckDetail)
    {
        return inventoryCheckDetailMapper.selectInventoryCheckDetailList(inventoryCheckDetail);
    }

    /**
     * 新增库存盘点单据详情
     * 
     * @param inventoryCheckDetail 库存盘点单据详情
     * @return 结果
     */
    @Override
    public int insertInventoryCheckDetail(InventoryCheckDetail inventoryCheckDetail)
    {
        inventoryCheckDetail.setCreateTime(DateUtils.getNowDate());
        return inventoryCheckDetailMapper.insertInventoryCheckDetail(inventoryCheckDetail);
    }

    /**
     * 修改库存盘点单据详情
     * 
     * @param inventoryCheckDetail 库存盘点单据详情
     * @return 结果
     */
    @Override
    public int updateInventoryCheckDetail(InventoryCheckDetail inventoryCheckDetail)
    {
        inventoryCheckDetail.setUpdateTime(DateUtils.getNowDate());
        return inventoryCheckDetailMapper.updateInventoryCheckDetail(inventoryCheckDetail);
    }

    /**
     * 批量删除库存盘点单据详情
     * 
     * @param ids 需要删除的库存盘点单据详情主键
     * @return 结果
     */
    @Override
    public int deleteInventoryCheckDetailByIds(Long[] ids)
    {
        return inventoryCheckDetailMapper.deleteInventoryCheckDetailByIds(ids);
    }

    /**
     * 删除库存盘点单据详情信息
     * 
     * @param id 库存盘点单据详情主键
     * @return 结果
     */
    @Override
    public int deleteInventoryCheckDetailById(Long id)
    {
        return inventoryCheckDetailMapper.deleteInventoryCheckDetailById(id);
    }
}
